<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center serviceList_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub serviceList_fd0_0'>
					<view class='flex flex-wrap align-center serviceList_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  serviceList_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<text class='serviceList_fd0_0_c1'>服务列表</text>
					<view class='flex flex-wrap align-center justify-end serviceList_fd0_0_c0'>
						<image class='serviceList_fd0_0_c2_c0' mode="aspectFit" :src='STATIC_URL+"75.png"'
							@tap.stop="handleJumpDiy" data-type="navigateTo"
							:data-url="`/pages/order/addProject/addProject`"></image>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!--服务分类选择器开始 -->
			<benben-picker ref="benbenWritePickerCodepicker1" :visible.sync="pickerDiy1677046556619"
				:label.sync='serviceLable' :value.sync='serviceValue' :options='serviceType' @change="getServiceFunc()"
				mode='selector' :mask-show='true' :timeout='true' :picker-height='88' default-type='aid'
				:default-props='{"label":"category_name","value":"aid"}'>
				<template #picker-header>
					<view class='flex flex-wrap align-center justify-between serviceList_picker1_0'>
						<text class='serviceList_picker1_0_c0'
							@tap="$refs.benbenWritePickerCodepicker1.cancel()">取消</text>
						<text class='serviceList_picker1_0_c1'>请选择分类</text>
						<text class='serviceList_picker1_0_c2'
							@tap="$refs.benbenWritePickerCodepicker1.pickerConfirm()">确定</text>
					</view>
				</template>
			</benben-picker>
			<!--服务分类选择器结束 -->
			<view
				class="flex flex-direction flex-wrap align-stretch justify-between benben-position-layout flex serviceList_flex_2"
				:style="{top:(88+StatusBarRpx)+'rpx', }">
				<view>
					<benben-flex-tabs class-name='serviceList_benbenTabsfd2_0' v-model="tabs" ref="benben_tabsfd2_0"
						select-mark="benben_tabsfd2_0" key="benben_tabsfd2_0" :open-title-type='false'
						:open-sticky='true' :top='0' :is-show-content='false' :scrollspy='false'
						:tabs-info.sync="tabsInfofd2_0" @change="getServiceFunc()">

						<scroll-view @scroll="tabsInfofd2_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd2_0"
							class="benben-tabs" style="width:750rpx" :scroll-x="true"
							:scroll-left.sync="tabsInfofd2_0.moveX" scroll-with-animation="all .3s ease">
							<view class="benben-tabs-content" id="benben_tabsfd2_0-content">
								<view id="benben_tabsfd2_0-title"
									class="benben-tabs-title flex flex align-center justify-around">
									<view
										:class="{ 'checkTitlefd2_0': tabs == '0', 'flex flex-wrap align-center': true }"
										@tap="tabs = '0'" :id="`benben_tabsfd2_0-title-item-${'0'}`">

										<text>全部</text>

									</view>
									<view
										:class="{ 'checkTitlefd2_0': tabs == '1', 'flex flex-wrap align-center': true }"
										@tap="tabs = '1'" :id="`benben_tabsfd2_0-title-item-${'1'}`">

										<text>审核中</text>

									</view>
									<view
										:class="{ 'checkTitlefd2_0': tabs == '2', 'flex flex-wrap align-center': true }"
										@tap="tabs = '2'" :id="`benben_tabsfd2_0-title-item-${'2'}`">

										<text>审核成功</text>

									</view>
									<view
										:class="{ 'checkTitlefd2_0': tabs == '3', 'flex flex-wrap align-center': true }"
										@tap="tabs = '3'" :id="`benben_tabsfd2_0-title-item-${'3'}`">

										<text>审核失败</text>

									</view>
								</view>
								<view :style="{ left: tabsInfofd2_0.lineleft, maxWidth: tabsInfofd2_0.lineWidth ,}"
									id="benben_tabsfd2_0-line"
									class="benben-tabs-line flex benben-flex-tabs-line serviceList_linefd2_0"></view>
							</view>
						</scroll-view>

					</benben-flex-tabs>

				</view>
				<view class='flex flex-wrap align-center serviceList_fd2_1'>
					<view class='flex flex-wrap align-center flex-sub serviceList_fd2_1_c0'>
						<image class='serviceList_fd2_1_c0_c0' mode="aspectFit" :src='STATIC_URL+"33.png"'></image>
						<benben-input class='flex-sub serviceList_fd2_1_c0_c1' type="text" :placeholder="`请输入你想要搜索的商品`"
							confirm-type="done" :maxlength="-1"
							placeholder-style="color:rgba(191, 191, 191, 1);font-size:24rpx" @confirm="getServiceFunc()"
							v-model="keyword" />
					</view>
				</view>

			</view>
			<view :style="{height: '170rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout serviceList_flex_3">
				<template v-for='(item,key0) in serviceList'>
					<view class='flex flex-direction flex-wrap align-stretch serviceList_fd3_0' :key='key0'>
						<view class='flex flex-wrap align-center justify-end serviceList_fd3_0_c0'>
							<text class='serviceList_fd3_0_c0_c0' v-if="item.examine=='1'">审核中</text><text
								class='serviceList_fd3_0_c0_c0' v-if="item.examine=='2'">审核成功</text><text
								class='serviceList_fd3_0_c0_c0' v-if="item.examine=='3'">审核失败</text>
						</view>
						<view class='flex flex-wrap align-center serviceList_fd3_0_c1'>
							<image class='serviceList_fd3_0_c1_c0' mode="aspectFill" :src='item.picture'></image>
							<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
								<text class='serviceList_fd3_0_c1_c1_c0'>{{item.service_title}}</text>
								<view class='flex flex-wrap align-center'>
									<text class='serviceList_fd3_0_c1_c1_c1_c0'>售出</text>
									<text class='serviceList_fd3_0_c1_c1_c1_c0'>{{item.sales_volume}}</text>
									<text class='serviceList_fd3_0_c1_c1_c1_c0'>件</text>
								</view>
								<view class='flex flex-wrap align-center serviceList_fd3_0_c1_c1_c2'>
									<text class='serviceList_fd3_0_c1_c1_c2_c0'>￥</text>
									<text class=' serviceList_fd3_0_c1_c1_c2_c1'>
										<text>{{ item.deposit_money | frontPrice }}</text>
										<text
											class=' serviceList_price2_fd3_0_c1_c1_c2_c1'>{{ item.deposit_money | laterPrice }}</text>
									</text>
								</view>
							</view>
						</view>
						<view class='flex flex-wrap align-center justify-end serviceList_fd3_0_c2'
							v-if=" item.examine=='2'">
							<button class='serviceList_fd3_0_c2_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
								:data-url="`/pages/order/addProject/addProject?aid=${item.aid}&shopID=${shopID}`">编辑</button>
							<button class='serviceList_fd3_0_c2_c0' @tap.stop="deleteServiceFunc(item.aid)">删除</button>
						</view>
						<view class='flex flex-wrap align-center justify-end serviceList_fd3_0_c2'
							v-if=" item.examine=='3'">
							<button class='serviceList_fd3_0_c2_c0' @tap.stop="handleJumpDiy" data-type="navigateTo"
								:data-url="`/pages/order/addProject/addProject?aid=${item.aid}&shopID=${shopID}`">重新提交</button>
						</view>
					</view>
				</template>
				<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
					:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"tabsInfofd2_0": {
					lineleft: '',
					lineWidth: '',
					moveX: 0,
					scrollX: 0,
					PageScrollX: 0
				},
				"pickerDiy1677046556619": false,
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"serviceLable": "保洁清洗",
				"serviceValue": "26",
				"keyword": "",
				"serviceType": [],
				"tabs": "0",
				"serviceList": [],
				"shopID": uni.getStorageSync('shopID') || ''
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.shopID = uni.getStorageSync('shopID') || ''
			this.getServiceFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.getServiceFunc()
		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取服务信息
			getServiceFunc() {
				this.minixPagingListsApi = global.apiUrls.post640fde5ee9ed2;
				this.pageingListApiMethod = 'post';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					type: this.serviceValue,
					keyword: this.keyword,
					// usermerchant_id: this.shopID,
					examine: this.tabs
				}
				this.listData = [];
				this.serviceList = this.listData;
				this.pagingListToggle();

			},
			//删除服务
			async deleteServiceFunc(deleteID) {
				//请求方法
				//数据验证

				let data64620adc7b140 = await this.$api.dbGet(global.apiUrls.post64620adc7b140, {
					aid: deleteID
				});
				if (!data64620adc7b140) return
				if (data64620adc7b140.data.code != 1) {
					this.$message.info(data64620adc7b140.data.msg);
					return
				}



				this.$message.info('删除成功');
				setTimeout(() => {
					this.getServiceFunc()
				}, 500)
			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.serviceList_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.serviceList_fd0_0_c2_c0 {
		width: 40rpx;
		height: 40rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.serviceList_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.serviceList_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.serviceList_fd0_0_c0 {
		width: 200rpx;
		height: 88rpx;
	}

	.serviceList_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.serviceList_picker1_0_c2 {
		color: rgba(230, 0, 54, 1);
		font-size: 32rpx;
		font-weight: 400;
		line-height: 45rpx;
	}

	.serviceList_picker1_0_c1 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.serviceList_picker1_0_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
	}

	.serviceList_picker1_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		height: 100rpx;
	}

	.serviceList_flex_2 {
		background: rgba(248, 248, 248, 1);
		width: 750rpx;
		height: 170rpx;
		overflow: hidden;
		z-index: 10;
		top: 88rpx;
		background-size: 100% auto;
	}

	.serviceList_fd2_1_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
	}

	.serviceList_fd2_1_c0_c0 {
		width: 32rpx;
		height: 32rpx;
		margin: 0rpx 20rpx 0rpx 0rpx;
	}

	.serviceList_fd2_1_c0 {
		background: #fff;
		height: 64rpx;
		background-size: 100% auto !important;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.serviceList_fd2_1 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.serviceList_linefd2_0 {
		background: #d53215;
		width: 32rpx;
		height: 10rpx;
		top: 80rpx;
		background-size: 100% auto !important;
		border-radius: 0rpx 0rpx 16rpx 16rpx;
	}

	.checkTitlefd2_0 {
		font-weight: 700 !important;
		font-size: 28rpx !important;
		color: rgba(230, 0, 0, 1) !important;
		background-color: rgba(255, 255, 255, 0) !important;
	}

	::v-deep .serviceList_benbenTabsfd2_0 {
		width: 750rpx;
		height: 88rpx;
		white-space: nowrap;
		text-align: center;
	}

	.serviceList_flex_3 {
		padding: 24rpx 24rpx 0rpx 24rpx;
	}

	.serviceList_fd3_0_c2_c0 {
		border: 1px solid #eee;
		background: #fff;
		border-radius: 32rpx 32rpx 32rpx 32rpx;
		font-size: 24rpx;
		color: #333;
		padding: 0rpx 40rpx 0rpx 40rpx;
		height: 64rpx;
		line-height: 64rpx;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.serviceList_fd3_0_c2 {
		border-top: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.serviceList_price2_fd3_0_c1_c1_c2_c1 {
		font-size: 22rpx;
	}

	.serviceList_fd3_0_c1_c1_c2_c1 {
		font-size: 36rpx;
		font-weight: 600;
		color: #E60000;
		line-height: 50rpx;
	}

	.serviceList_fd3_0_c1_c1_c2_c0 {
		font-size: 20rpx;
		font-weight: 600;
		color: rgba(230, 0, 54, 1);
	}

	.serviceList_fd3_0_c1_c1_c2 {
		margin: 12rpx 0rpx 0rpx 0rpx;
	}

	.serviceList_fd3_0_c1_c1_c1_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
		line-height: 33rpx;
	}

	.serviceList_fd3_0_c1_c1_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
		line-height: 45rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.serviceList_fd3_0_c1_c0 {
		width: 160rpx;
		height: 160rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		margin: 0rpx 24rpx 0rpx 0rpx;
	}

	.serviceList_fd3_0_c1 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.serviceList_fd3_0_c0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		line-height: 40rpx;
	}

	.serviceList_fd3_0_c0 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.serviceList_fd3_0 {
		background: #fff;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 0rpx 24rpx 0rpx 24rpx;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}
</style>